/**************************************************************************************
*
*	Copyright (C) 2010 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	GuiInterfaces.h
*
*	Description -	Graphical screen object interface classes.
*
*	Comments	-	
*					
*	Modification History:
*			Name			   Date					Description
*			CodeSushi	-	06/18/11	-	Creation of this file
**************************************************************************************/

#ifndef _PSX_SCREEN_ELEMENT_H_
#define _PSX_SCREEN_ELEMENT_H_

#include "PulseSTD.h"
#include "Engine.h"
#include "Vector3.h"
#include "2D.h"

namespace Pulse
{

	class ScreenElement
	{
	public:

		virtual INT		GetZOrder( void ) const = 0;
		virtual void	SetZOrder( CONST INT ZOrder ) = 0;
		virtual BOOL	IsVisible( void ) const = 0;
		virtual void	SetVisible( BOOL bVisible ) = 0;

		virtual EErrorCode::Type	OnRestore( void ) = 0;
		virtual EErrorCode::Type	OnRender( DOUBLE time, FLOAT dt ) = 0;
		virtual void				OnUpdate( INT deltaMilliSeconds ) = 0;
		virtual EErrorCode::Type	OnMsgProc( AppMsg msg ) = 0;

		// Add operator < here

		virtual ~ScreenElement( void ) { }

	protected:

	};

	// 
	class GUIBase
	{
	public:

		GUIBase( void );
		virtual ~GUIBase( void );

		virtual INT		GetZOrder( void ) const			{ return (INT)m_pos.z; }
		virtual void	SetZOrder( CONST INT ZOrder )	{ (INT)m_pos.z; }
		virtual BOOL	IsVisible( void ) const			{ return m_bVisible; }
		virtual void	SetVisible( BOOL bVisible )		{ m_bVisible = bVisible; }
		Vector3 *		GetPosition( void )				{ return &m_pos; }

		virtual EErrorCode::Type	OnRestore( void )					= 0;
		virtual EErrorCode::Type	OnRender( DOUBLE time, FLOAT dt )	= 0;
		virtual void				OnUpdate( INT deltaMilliSeconds )	{ };
		virtual EErrorCode::Type	OnMsgProc( AppMsg msg )				= 0;

		// Add operator < here

	protected:

		GUIBase *m_pParent;

		Vector3 m_pos;
		Size2	m_size;
		BOOL	m_bVisible;

	};

}

#endif /* _PSX_SCREEN_ELEMENT_H_ */